import UIKit

extension UIColor {
    var cssColor: String {
        var red: CGFloat = 0
        var green: CGFloat = 0
        var blue: CGFloat = 0
        var alpha: CGFloat = 0
        
        getRed(&red, green: &green, blue: &blue, alpha: &alpha)
        
        return String(format: "rgba(%d, %d, %d, %.2f)",
                     Int(red * 255),
                     Int(green * 255),
                     Int(blue * 255),
                     alpha)
    }
} 